package com.ruoyi.web.controller.monitor;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.monitor.domain.BusWaterIntegrationmonitordataYear;
import com.ruoyi.monitor.service.IBusWaterIntegrationmonitordataYearService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 手工监测数据（年）Controller
 * 
 * @author maliang
 * @date 2025-08-16
 */
@RestController
@RequestMapping("/monitor/integrationmonitordatayear")
public class BusWaterIntegrationmonitordataYearController extends BaseController
{
    @Autowired
    private IBusWaterIntegrationmonitordataYearService busWaterIntegrationmonitordataYearService;

    /**
     * 查询手工监测数据（年）列表
     */
    @PreAuthorize("@ss.hasPermi('monitor:integrationmonitordatayear:list')")
    @GetMapping("/list")
    public TableDataInfo list(BusWaterIntegrationmonitordataYear busWaterIntegrationmonitordataYear)
    {
        startPage();
        List<BusWaterIntegrationmonitordataYear> list = busWaterIntegrationmonitordataYearService.selectBusWaterIntegrationmonitordataYearList(busWaterIntegrationmonitordataYear);
        return getDataTable(list);
    }

    /**
     * 导出手工监测数据（年）列表
     */
    @PreAuthorize("@ss.hasPermi('monitor:integrationmonitordatayear:export')")
    @Log(title = "手工监测数据（年）", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BusWaterIntegrationmonitordataYear busWaterIntegrationmonitordataYear)
    {
        List<BusWaterIntegrationmonitordataYear> list = busWaterIntegrationmonitordataYearService.selectBusWaterIntegrationmonitordataYearList(busWaterIntegrationmonitordataYear);
        ExcelUtil<BusWaterIntegrationmonitordataYear> util = new ExcelUtil<BusWaterIntegrationmonitordataYear>(BusWaterIntegrationmonitordataYear.class);
        util.exportExcel(response, list, "手工监测数据（年）数据");
    }

    /**
     * 获取手工监测数据（年）详细信息
     */
    @PreAuthorize("@ss.hasPermi('monitor:integrationmonitordatayear:query')")
    @GetMapping(value = "/{reportid}")
    public AjaxResult getInfo(@PathVariable("reportid") String reportid)
    {
        return success(busWaterIntegrationmonitordataYearService.selectBusWaterIntegrationmonitordataYearByReportid(reportid));
    }

    /**
     * 新增手工监测数据（年）
     */
    @PreAuthorize("@ss.hasPermi('monitor:integrationmonitordatayear:add')")
    @Log(title = "手工监测数据（年）", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BusWaterIntegrationmonitordataYear busWaterIntegrationmonitordataYear)
    {
        return toAjax(busWaterIntegrationmonitordataYearService.insertBusWaterIntegrationmonitordataYear(busWaterIntegrationmonitordataYear));
    }

    /**
     * 修改手工监测数据（年）
     */
    @PreAuthorize("@ss.hasPermi('monitor:integrationmonitordatayear:edit')")
    @Log(title = "手工监测数据（年）", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BusWaterIntegrationmonitordataYear busWaterIntegrationmonitordataYear)
    {
        return toAjax(busWaterIntegrationmonitordataYearService.updateBusWaterIntegrationmonitordataYear(busWaterIntegrationmonitordataYear));
    }

    /**
     * 删除手工监测数据（年）
     */
    @PreAuthorize("@ss.hasPermi('monitor:integrationmonitordatayear:remove')")
    @Log(title = "手工监测数据（年）", businessType = BusinessType.DELETE)
	@DeleteMapping("/{reportids}")
    public AjaxResult remove(@PathVariable String[] reportids)
    {
        return toAjax(busWaterIntegrationmonitordataYearService.deleteBusWaterIntegrationmonitordataYearByReportids(reportids));
    }
}
